#include <ptgui/ptgui.h>
#include <SDL/SDL.h>
#include "system.h"

extern void rt_mq_system_init();
extern void rt_mb_system_init();
extern void rt_thread_system_init();
extern void sdl_driver_init();
extern int rt_application_init();

int main(int argc, char *argv[])
{
	SDL_Event event;
	int done = 0;
	int button_state = 0;

	rt_kprintf("PTGUI simulator ....\n");

	/* init rtt system */
	rt_mq_system_init();
	rt_mb_system_init();
	rt_thread_system_init();

	/* init driver */
	sdl_driver_init();

	/* init gui system */
	ptgui_system_init();

	/* initial user application */
	rt_application_init();	

	/* handle SDL event */
	while (!done) {
		/* Check for events */
		while (SDL_PollEvent(&event)) {
			switch (event.type) {
			case SDL_MOUSEMOTION:
				{
					
				}
				break;

			case SDL_MOUSEBUTTONDOWN:
			case SDL_MOUSEBUTTONUP:
				{
					
				}
				break;

			case SDL_KEYUP:
				{
				}
				break;

			case SDL_KEYDOWN:
				{
				}
				break;

			case SDL_QUIT:
				done = 1;
				break;

			default:
				break;
			}

			SDL_Delay(20);
		}
	}

	SDL_Quit();

	return 0;
}
